package com.scirillo.frases.service;
import com.scirillo.frases.notification.FrasesNotificationManager;

import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;

public class NotifyService  extends Service 
{
	
	private final LocalBinder mBinder = new LocalBinder();
	private static NotifyService mInstance; 

	
	public static NotifyService getInstance(){
		return mInstance;
	}
	
	@Override
	public int onStartCommand(Intent intent, int flags, int startId) {	
		return START_NOT_STICKY;
	}
 
	@Override
	public IBinder onBind(Intent intent) {
		return mBinder;
	}	
	
	@Override
	public boolean onUnbind(Intent intent) {	
		return super.onUnbind(intent);
	}	
	
	public class LocalBinder extends Binder {
	    public NotifyService getService() {
	    return NotifyService.this;
	  }
	}	
	
	public static NotifyService getService(){
		return mInstance;
	}
	
	@Override
	public void onCreate() {
		mInstance = this;
	//	Util.getInstance().displayNotification();
		FrasesNotificationManager.displaytNotification();
		super.onCreate();
	}
	
	@SuppressWarnings("deprecation")
	@Override
	public void onStart(Intent intent, int startId) {
		FrasesNotificationManager.displaytNotification();
		super.onStart(intent, startId);
	}

}
